﻿using System;
using System.Threading;
using System.Windows;

namespace RedBit.UserVoice.Helpers
{
    public class DebugHelper
    {
        private static DateTime? First = null;
        private static string MESSAGE_STRING = "Thread: {0} - {1}:{2}:{3}";


        public static void Write(string msg)
        {
            if (!First.HasValue)
                First = DateTime.Now;
            System.Diagnostics.Debug.WriteLine(string.Format(MESSAGE_STRING, Thread.CurrentThread.ManagedThreadId, DateTime.Now.Second , DateTime.Now.Millisecond , msg));
        }

        public static void WriteTotalTime()
        {
            TimeSpan diff = DateTime.Now.Subtract(First.Value);

            System.Diagnostics.Debug.WriteLine("Total Time: " + diff.Seconds + ":" + diff.Milliseconds);
        }

        
    }
}
